package com.fire.control.system.job;

import org.quartz.DisallowConcurrentExecution;
import org.quartz.Job;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.PersistJobDataAfterExecution;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;

import com.fire.control.system.module.duty.service.IDutyService;

/**
* @ClassName: DeviceDetectionJob
* @Description: TODO(检测值班是否签到)
* @author wanbo
* @date 2017年6月29日 下午3:55:23
*/
@PersistJobDataAfterExecution
//@DisallowConcurrentExecution
public class DutyDetectionJob implements Job {
	
	private static final Logger logger = LoggerFactory.getLogger(DutyDetectionJob.class);
	
	@Autowired IDutyService dutyService;
	
	@Override
	public void execute(JobExecutionContext context) throws JobExecutionException {
		String jobName = (String)context.getMergedJobDataMap().get("job");
		logger.info("--------quartz job:"+jobName);
		dutyService.updateTodayDutyNoAttendance();
	}

}